package com.txby.pf.modules.busi.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.txby.pf.modules.busi.dao.BusiNewsDao;
import com.txby.pf.modules.busi.entity.BusiNewsEntity;
import com.txby.pf.modules.busi.service.BusiNewsService;


/**
 * 新闻
 * 
 */
@Service("busiNewsService")
public class BusiNewsServiceImpl implements BusiNewsService {
	@Autowired
	private BusiNewsDao busiNewsDao;
	
	@Override
	public List<BusiNewsEntity> queryList(Map<String, Object> map){
		return busiNewsDao.queryList(map);
	}
	
	@Override
	public int queryTotal(Map<String, Object> map) {
		return busiNewsDao.queryTotal(map);
	}

	@Override
	@Transactional
	public void save(BusiNewsEntity news) {
		news.setCreateTime(new Date());
		busiNewsDao.save(news);
	}

	@Override
	@Transactional
	public void update(BusiNewsEntity news) {
		busiNewsDao.update(news);
	}

	@Override
	public void deleteBatch(Long[] newsIds) {
		busiNewsDao.deleteBatch(newsIds);
	}

	@Override
	public BusiNewsEntity queryObject(Long newsId) {
		return busiNewsDao.queryObject(newsId);
	}

}
